  // fn();
    // function fn()
    // {
    //获取文科输入的值
    // let username = document.getElementById("username").value;
    //console.log(username);
    // let pass = document.getElementById("pass").value;
     let user = { username:"admin1",password:"12345" }
    let fs=require('fs');
    let data =JSON.parse(fs.readFileSync(__dirname+"/作业要求/persons.json","utf8"));

    // 存储的数据
    let persons =data;
    console.log(persons);

    // //匹配数据  文科输入的数据是否满足存储中数据内容
    let use = persons.find((item)=>{
      //console.log(item);  
      return item.username == user.username && item.password == user.password;
    })
    if(use)
    {
      alert("登录成功")
    }else
    {
      alert("登录失败")  
    }

    // }